<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'document-success.jsp' starting page</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jQuery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<style type="text/css">
body {
	background-color: #3D71BC;
	background-image: url("img/pro-bg1.jpg");
	background-repeat: no-repeat;
	width: 1005px;
}

.span3 {
	margin-top: 30px;
	height: 620px;
	margin-left: 0px;
	background-color: #fff;
	border-radius: 0px 160px 6px 0px;
	opacity: 0.3;
}

.flow {
	font-size: 22px;
	overflow: hidden;
	height: 140px;
	width: 300px;
}

.c-right {
	margin-right: auto;
}

li:hover {
	color: #fff;
}

.body-bgc {
	padding-top: 20px;
	width: 800px;
	background-color: #bod4e5;
	background: url("img/wash-white-30.png") repeat scroll 0 0 transparent;
}

.btn-fb {
	padding: 5px;
	margin: 15px;
	width: 65px;
	height: 45px;
	line-height: 45px;
	font-size: 20px;
	border-radius: 8px;
}

.title {
	height: 30px;
	width: 220px;
	background-image: url("img/title.png");
	background-repeat: no-repeat;
}

hr {
	margin: 5px 10px 10px 0;
}

.newproject {
	margin-bottom: 20px;
	margin-left: 25px;
}

.accordion-heading {
	height: 30px;
	background-color: #fff;
	opacity: 0.8;
}

.contents {
	word-wrap: break-word;
	width: 600px;
	margin-left: 20px;
	font-size: 16px;
}

.collapse {
	background-color: #fff;
	opacity: 0.6;
}

.span5 {
	width: 280px;
	margin-left: 50px;
	margin-top: 110px;
	opacity: 0.7;
}

.span6 {
	width: 295px;
	margin-left: 60px;
	margin-right: 20px;
	margin-top: 110px;
	float: right;
	opacity: 0.65;
}

#linkrecordcontent {
	border-left: 6px solid #fff;
}

#linkrecordcreatetime {
	border-left: 6px solid #fff;
}
</style>
</head>

<body>
	<%@ include file="include/topbar.jsp"%>
	<%@ include file="include/left.jsp"%>

	<div class="span5 well">
		<h3>
			<i class="icon-user"></i>联系人
		</h3>

		<a href="addlinkman.action" class="btn success">添加新联系人</a><br />
		<c:if test="${empty linkmanList}">
			<div class="alert alert-info">还没联系人</div>
		</c:if>
		<c:forEach var="linkman" items="${linkmanList}">
			<i class="icon-list-alt"></i>
			<a class="linkman" rel="${linkman.id}" href="javascript:void(0)">${linkman.name}</a>
			<br />
		</c:forEach>
	</div>


	<div id="link" class="span6 well" style="display:none;">

		姓名：<span id="name"></span> <br /> 公司:<span id="companyName"></span><br />
		手机：<span id="linkmanmobile"></span><br /> 固话：<span id="linkmantel"></span><br />
		<br /> 邮箱：<span id="linkmanemail"></span><br /> 地址：<span
			id="linkmanaddress"></span><br /> <br /> 主页：<a href=""
			id="linkmanwebsite"></a><br /> 微博：<a href="" id="linkmanweibo"></a><br />
		<br /> <a id="edit" href="javascript:void(0)"><i
			class="icon-pencil"></i>编辑</a> <a class="deletefile" id="del"
			href="javascript:void(0)"><i class="icon-trash"></i>删除</a>
		&nbsp;&nbsp;&nbsp;&nbsp; <a id="alllinkrecord"
			href="javascript:void(0)" >查看联系人记录</a>


		<hr />
		<hr /><hr />

		所有联系人的记录：
		<c:if test="${empty linkrecordList}">
				暂时没有联系人记录
			</c:if>
		<hr>
		<c:forEach var="linkrecord" items="${linkrecordList }">
			<div id="linkrecordcontent">&nbsp;&nbsp;${linkrecord.content }</div>
			<div id="linkrecordcreatetime">
				&nbsp;&nbsp;-<span>${linkrecord.user.username}</span>&nbsp;

				發表于&nbsp;<span>${linkrecord.createtime }</span>
			</div>
			<hr />
		</c:forEach>
	</div>
	<div id="myModal3" class="modal fade">

		<div class="modal-header">
			<a class="close" data-dismiss="modal">x</a>
			<h2>删除记录</h2>
		</div>

		<div class="modal-body">
			<h3>确定删除？</h3>
		</div>

		<div class="modal-footer">
			<a id="entrydelete" class="btn btn-primary">删除</a> <a class="btn"
				data-dismiss="modal">取消</a>
		</div>

	</div>
</body>
<script type="text/javascript">
	$(function() {

		var id;
		$("#del").click(function() {
			if ($("#del").attr("rel") == null) {

			} else {
				$('#myModal3').modal('show');
			}
		});

		$('#entrydelete').click(function() {
			$('#myModa3').modal('hide');
			window.location.href = $("#del").attr("rel");
		});

		$(".linkman").click(
				function() {
					$.post("findlinkman.action", {
						"linkman.id" : $(this).attr("rel")
					},
							function(data) {

								json = data;
								$("#name").text(data.name);
								$("#companyName").text(data.company);
								$("#linkmanmobile").text(data.moblie);
								$("#linkmantel").text(data.tel);
								$("#linkmanemail").text(data.email);
								$("#companyaddress").text(data.address);
								$("#linkmanwebsite").text(data.website);
								$("#linkmanweibo").text(data.weibo);
								$("#del").attr("rel",
										"dellinkman.action?id=" + data.id);
								$("#edit").attr("href",
										"toeditlinkman.action?id=" + data.id);

								$("#alllinkrecord").attr("href",
										"findallrecord.action?id=" + data.id);

								$("#link").show();
							});
				});

	});
</script>

</html>
